import { useState } from 'react'
import UpdateElectron from '@/components/update'
import logoVite from '@/assets/logo-vite.svg'
import logoElectron from '@/assets/logo-electron.svg'
import './index.css'

function Home() {
  const [count, setCount] = useState(0)

  return (
    <div className="home-page">
      <div className="logo-box">
        <img src={logoVite} className="logo vite" alt="Electron + Vite logo" />
        <img src={logoElectron} className="logo electron" alt="Electron + Vite logo" />
      </div>
      <h1>Electron + Vite + React</h1>
      <div className="card">
        <button onClick={() => setCount(count => count + 1)}>计数是 {count}</button>
        <p>
          编辑 <code>src/pages/Home/index.tsx</code> 并保存以测试热重载
        </p>
      </div>
      <p className="read-the-docs">点击 Electron + Vite 标志了解更多</p>
      <div className="flex-center">
        将静态文件放入 <code>/public</code> 文件夹{' '}
        <img style={{ width: '5em' }} src="./node.svg" alt="Node logo" />
      </div>

      <UpdateElectron />
    </div>
  )
}

export default Home
